package org.liveboardgames.agricola.control.delegates.mock
{
    import org.liveboardgames.agricola.model.enums.ResourceTypeEnum;
    import org.liveboardgames.agricola.vo.card.ResourceTransformation;
    
    import mx.collections.ArrayCollection;
    import mx.collections.ListCollectionView;
    
    public class ResourceTransformationFactory
    {
        public static function getPossibleTransformationsForCooking(sheep:int, boar:int, cattle:int, vegetable:int, grain:int):ListCollectionView
        {
            var possibleTransformations:ListCollectionView = new ArrayCollection();
            if (sheep != 0)
            {
                var sheepCooking:ResourceTransformation = new ResourceTransformation(ResourceTypeEnum.SHEEP, ResourceTypeEnum.
                    FOOD, 1, sheep);
                possibleTransformations.addItem(sheepCooking);
            }
            if (boar != 0)
            {
                var boarCooking:ResourceTransformation = new ResourceTransformation(ResourceTypeEnum.BOAR, ResourceTypeEnum.
                    FOOD, 1, boar);
                possibleTransformations.addItem(boarCooking);
            }
            if (cattle != 0)
            {
                var cattleCooking:ResourceTransformation = new ResourceTransformation(ResourceTypeEnum.CATTLE, ResourceTypeEnum.
                    FOOD, 1, cattle);
                possibleTransformations.addItem(cattleCooking);
            }
            if (vegetable != 0)
            {
                var vegetableCooking:ResourceTransformation = new ResourceTransformation(ResourceTypeEnum.VEGETABLE, ResourceTypeEnum.
                    FOOD, 1, vegetable);
                possibleTransformations.addItem(vegetableCooking);
            }
            if (grain != 0)
            {
                var grainCooking:ResourceTransformation = new ResourceTransformation(ResourceTypeEnum.GRAIN, ResourceTypeEnum.
                    FOOD, 1, grain);
                possibleTransformations.addItem(grainCooking);
            }
            
            return possibleTransformations;
        }
        
        public static function getPossibleTransformationsForBaking(grain:int, numberOfUses:int):ListCollectionView
        {
            var possibleTransformations:ListCollectionView = new ArrayCollection();
            
            if (grain != 0)
            {
                var grainCooking:ResourceTransformation = new ResourceTransformation(ResourceTypeEnum.GRAIN, ResourceTypeEnum.
                    FOOD, 1, grain, numberOfUses);
                possibleTransformations.addItem(grainCooking);
            }
            
            return possibleTransformations;
        }
    
    }
}